unit IDMaster;

interface
type cIDMaster = class(TObject)
	private
	nextUniqueID : integer;
	public
	procedure _init_;
	function GetUniqueID: integer;
	procedure Reset;
	procedure DeclareObject(ObjectID: integer);
	end;

implementation

procedure cIDMaster.Reset;
begin
nextUniqueID := 1;
end;

procedure cIDMaster._init_;
begin
self.reset;
end;

function cIDMaster.GetUniqueID;
var p: integer;
begin
p:=nextUniqueID;
nextUniqueID := nextUniqueID + 1;
result:=p;
end;

procedure cIDMaster.DeclareObject(ObjectID: integer);
begin
nextUniqueID := ObjectID + 1;
end;

end.
